Next | Prev | Top | Contents | Index

Chapter 1: About the MIPSpro Compiler System


The MIPSpro compiler system consists of a set of components that enable you to create executable programs using such languages as C, C++, and Fortran.

A new 32-bit mode, n32, was introduced with the IRIX 6.1 operating system. This new 32-bit mode has the following features:

This new 32-bit mode provides higher performance than the old 32-bit mode available in IRIX releases prior to 6.1. When you compile -32 in IRIX 6.1, the chip executes in 64-bit mode (UX=1) and the software restricts addresses to 32-bits. For more information about n32, refer to the MIPSpro N32 ABI Handbook.

In addition, the compiler system:

Table 1-1 summarizes the compiler system components and the task each performs.

Compiler System Functional Components
ToolTaskExamples
Text editorWrite and edit programsvi, jot, emacs
Compiler driverCompile, link, and load programscc, CC, f77, f90, pc, as
Object file analyzerAnalyze object filesdis, dwarfdump, elfump, file, nm, size
ProfilerAnalyze program performanceprof, pixie
Procedure rearrangerMinimize paging/maximize instruction cache hit ratecord
ArchiverProduce object-file librariesar
LinkerLink object filesld
Runtime linkerLink Dynamic Shared Objects at runtimerld
DebuggerDebug programsdbx

A single program called a compiler driver (such as cc, CC, or f77) invokes the following major components of the compiler system (refer to Figure 1-1).

You can invoke a compiler driver with various options (described later in this chapter) and with one or more source files as arguments. All specified source files are automatically sent to the macro preprocessor.Although the macro preprocessor was originally designed for C programs, it is now run by default as part of most compilations. To prevent running the preprocessor, use the -nocpp option on the driver command line. For C and C++ compilations, preprocessing and front-end compilation is done by fec and fecc. For all other compilations, preprocessing is done by invocation of a separate executable named cpp.

If available, the parallel analyzers pca, fef77p, or fef90p produce parallelized source code from standard source code. mpc takes the output from pca and produces parallel C code (part of Power C). The result takes advantage of multiple CPUs (when present) to achieve higher computation rates. pca and mpc are part of Power C. Power Fortran automatically uses the parallel Fortran compiler, fef77p or fef90p, to produce parallel code. For more information about these packages and how to obtain them, contact your dealer/sales representative. The compiler front ends (fec, fecc, fef77, fef90) translate the source code into an intermediate tree representation. The compiler back end (be) translates the intermediate code into object code. The language compilers share the same back end (be), which combines optimization and code generation in one phase. (For more information about optimization, see Chapter 5, "Optimizing Program Performance.")

The linker ld combines several object files into one, performs relocation, and resolves external symbols. The driver automatically runs ld unless you specify the -c option to skip the linking step.

When you compile or link programs, by default, the compiler searches /usr/lib, /lib, and /usr/local/lib. Certain default libraries are automatically linked. Drivers and their respective libraries are listed in Table 1-2.

Compilers and Default Libraries
CompilerDefault Libraries
cclibc.so
CClibC.so, libc.so
f77, f90libftn.so, libftn90.so, libc.so, libm.so

To see the various utilities a program passes through during compilation, invoke the appropriate driver with the -show option.

Figure 1-1 shows compilation flow from source file to executable file (a.out).

Figure 1-1 : Compiler System Flowchart This chapter describes the components of the MIPSpro compiler system, and explains how to use them.



Next | Prev | Top | Contents | Index